Skip to content

Conversation

ericyang125
Copy link
Contributor

Reduced technical debt from original adaptation of pure ptyhon algorithm, which should make future development easier. Refined the gpu PIV-processing functions for better resource-use efficiency, and speed. PIV results should be more accurate at the subpixel level. PIV should be more robust near edges of masks/imagesfinements to the gpu_process module targeting increased readability, resource-use efficiency, and speed.

Main changes:

  • Broke-up the old F-structure from widim into smaller arrays to make development easier.
  • Remove dependence on Cython, since acceleration can be done completely by CUDA and numpy routines.
  • Increase speed of PIV processingSpeed has been increased by GPU-accelerating remaining cpu-bound functions and using faster alternatives to some logic--time to complete a 10-image-pair benchmark with 5 iterations and minimum windows size of 8 was reduced by ~75%.
  • Add validation module with validation routines. This can be used independently of the processing module.
  • MakLarge functions with high number of degrees of freedom object-orientedhave broken into smaller, more specialized functions.
  • Add test modules covering gpu functions. There are unit tests and regression tests.
  • Create gpu_smoothn module containingn smoothn logic that is more readable, and which will allow for GPU-acceleration in the future.
  • Put all gpu modules into their package to be a clean add-on to base python pacakage.
  • GPU-accelerated functions are broken across multiple modules in a single package added on top of OpenPIV.
  • Test using CUDA 12.

Improved functionality:

  • Change specification of window sizes and iterations into one argument, which is most clear to users.
  • Validate user inputs to processing functions using Python descriptors.
  • Add centroid and parabolic subpixel estimation methodsAdd centriod and parabolic subpixel estimation methods.
  • Validate user inputs to processing functions using Python descriptors
  • Change specification of window sizes and iterations into one argument, which is most clear to users.
  • put all gpu modules into their package to be a clean add-on to base python pacakage.

Other changes:

  • Refactor variables names to be more clear.
  • GPU-accelerated functions are broken across multiple modules.
  • Mask images before doing PIV.
  • Include subpixel and centroid subpixel methods.
  • Masked points are not considered in the validation or as data for smoothing.
  • Replace vectors with median vectors.
  • Add input checks to PIV parametersmove gpu_extended_search_area since it wraps negligible logic and remains unused.
  • Update README.
  • Add input checks to PIV parameters.
  • Include subpixel and centroid subpixel methods.
  • Consolidate validation gpu kernels into fewer kernels.
  • Move kernel compilation out of functions so they don't compile more than once.
  • Add ability to center vector field on image domain. This is now default behaviour.
  • Log processing using logging module status rather than printing to console. This cleans up output when using multiple processes or wrappers.
  • Add gpu function to interpolate from masked data.
  • Add GPU cosine transform to gpu_smoothn module.
  • Add methods to free gpu data held by classes.
  • Use only positive values in subpixel estimation.
  • Estimate strain next to masked points and edges using first-order differencing.

Performance:

  • Consolidate validation gpu kernels into fewer kernels.
  • Optimize GPU kernels doing vector replacement, subpixel approximation, window deformation, masking, gradient approximation, validation.
  • Simplify logic in all gpu kernels and remove as many switch cases as possible.
  • Move kernel compilation out of functions so they don't compile more than once.
  • Eliminate switching between multiple contexts for single process.
  • In most cases, create GPU arrays on the device itself to minimize transfers between CPU and GPU.
  • Simplify logic for vector replacement to avoid interpolating twice in one iteration.

Other changes:

  • RefactorUse private/public variable/function/method naming.
  • Optimize GPU kernels doing vector replacement, subpixel approximation, window deformation, masking, gradient approximation, validation.
  • Fix bugs in gradient approximation, suxpixel approximation, validation, smoothing, and other gpu kernels.
  • SImplify logic in all gpu kernels and remove as many switch cases as possible.
  • Add gpu function to interpolate from masked data.
  • In most cases, create GPU arrays on the device itself to minimize transfers between CPU and GPU.
  • Add GPU cosine transform to gpu_smoothn module.
  • Add methods to free gpu data
  • Use python data types for non-numpy-array varaiables names to be more clear.
  • Remove gpu_extended_search_area since it wrapped negligible logic and remaine.
  • Use only positive values in subpixel estimation.
  • Estimate strain next to masked points and edges
  • Simplify logic for vector replacement to avoid uintested.
  • Update README install instrucrpolating twice in one iterations.
  • Use private/public variable/function/method naming.
  • Fix bugs in gradient approximation, suxpixel approximation, validation, smoothing, and other gpu kernels.
  • Use python data types for non-numpy-array variables.
    Replace vectors with median vectors
  • Separate public from private methods
  • Test on the newest CUDA toolkit version

ericyang125 and others added 30 commits July 13, 2022 15:46
added simple_multiplass to windef, 0.24.2
…nd interpolation kernels. Remove switch cases from interpolation kernel.
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.0.0 to 4.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.0.0...v4.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
- pytest is only required to run the tests (added to extras_require)
- I didn't found watermark or GitPython used - removed
- Removed numpy from setup requires in pyproject.toml
ericyang125 and others added 25 commits December 2, 2023 22:25
…tx instead of pyucda.autoinit so that the context isn't destroyed by cufft.
…rties of openpiv.gpu.Validation. Add unit tests.
# Conflicts:
#	.github/workflows/build.yml
#	.github/workflows/publish-to-test-pypi.yml
#	.github/workflows/testing.yml
@ericyang125 ericyang125 changed the title Improve readability and performance of gpu-accleerated piv functions. Improve readability and performance of gpu-accelerated piv functions. Dec 16, 2023
@alexlib alexlib merged commit 1cc38c5 into OpenPIV:master Dec 24, 2023
@alexlib
Copy link
Member

alexlib commented Dec 24, 2023

Thanks a lot @ericyang125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants